<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * proseslowongan.php
 * @author ranuandra
 *
 * 6 Mei 2012 12:01:16
 *
 * 
 */

class Model_Proseslowongan extends ORM
{
	protected $_has_many = array(
							'pelamarproses' 	=> array('model' => 'pelamarproses'),
						);
	protected $_belongs_to = array(
							'mstlowongan'		=> array('model' 	=> 'mstlowongan'),
							'mstproses' 		=> array('model'	=> 'mstproses'),
							'user'				=> array('model'	=> 'user'),
						);
	private $_field = array('mstlowongan_id', 'mstproses_id', 'tanggal', 'alamat', 'flagproses', 'user_id');
	
	private $_form = array(
							'mstlowongan_id' => '', 
							'mstproses_id' => '', 
							'tanggal' => '', 
							'alamat' => '', 
							'user_id' => '', 
							'flagproses' => '', 
							);
	
	public function rules()
	{
		return array(
							'mstlowongan_id' => array(
										array('min_length', array(':value', 0)),
									 ), 
							'mstproses_id' => array(
										array('min_length', array(':value', 0)),
									 ), 
							'tanggal' => array(
										array('min_length', array(':value', 0)),
									 ),  
							'alaat' => array(
										array('min_length', array(':value', 0)),
									 ),  
							'user_id' => array(
										array('min_length', array(':value', 0)),
									 ),  
							'flagproses' => array(
										array('min_length', array(':value', 0)),
									 ),  
		
		); 
	}
	
	public function getField()
	{
		return $this->_field;
	}
	
	public function getForm()
	{
		return $this->_form;
	}
	
	public function create_data($values)
	{
	    return $this->values($values, $this->_field)->create();
	}	
}